package ch.esn.server.domain;

import java.util.Date;
import java.util.List;

import javax.jdo.annotations.Embedded;
import javax.jdo.annotations.EmbeddedOnly;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Person {

	@PersistenceCapable
	@EmbeddedOnly
	public static class PersonContactInfo {

		@Persistent
		private String phoneNumber;

		@Persistent
		private String socialNetworkPage;

		@Persistent
		private String other;

		public String getOther() {
			return other;
		}

		public String getPhoneNumber() {
			return phoneNumber;
		}

		public String getSocialNetworkPage() {
			return socialNetworkPage;
		}

		public void setOther(String other) {
			this.other = other;
		}

		public void setPhoneNumber(String phoneNumber) {
			this.phoneNumber = phoneNumber;
		}

		public void setSocialNetworkPage(String socialNetworkPage) {
			this.socialNetworkPage = socialNetworkPage;
		}
	}

	@PrimaryKey
	@Persistent
	private User appUser;

	@Persistent
	private String nickname;

	@Persistent
	private String country;

	@Persistent
	private String universtity;

	@Persistent
	private String faculty;

	@Persistent
	private List<Language> languagesSpoken;

	@Persistent
	private List<Availability> availableFor;

	@Persistent
	private List<User> friends;

	@Persistent
	private Date lastLogin;

	@Persistent
	@Embedded
	private PersonContactInfo contactInfo;

	public User getAppUserId() {
		return appUser;
	}

	public List<Availability> getAvailableFor() {
		return availableFor;
	}

	public PersonContactInfo getContactInfo() {
		return contactInfo;
	}

	public String getCountry() {
		return country;
	}

	public String getFaculty() {
		return faculty;
	}

	public List<User> getFriends() {
		return friends;
	}

	public List<Language> getLanguagesSpoken() {
		return languagesSpoken;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public String getNickname() {
		return nickname;
	}

	public String getUniverstity() {
		return universtity;
	}

	public void setAppUserId(User appUserId) {
		this.appUser = appUserId;
	}

	public void setAvailableFor(List<Availability> availableFor) {
		this.availableFor = availableFor;
	}

	public void setContactInfo(PersonContactInfo contactInfo) {
		this.contactInfo = contactInfo;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public void setFaculty(String faculty) {
		this.faculty = faculty;
	}

	public void setFriends(List<User> friends) {
		this.friends = friends;
	}

	public void setLanguagesSpoken(List<Language> languagesSpoken) {
		this.languagesSpoken = languagesSpoken;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public void setUniverstity(String universtity) {
		this.universtity = universtity;
	}

}
